#include "Hostile.h"

///////////////////////////////////////////////////////////////
// Default constructor.
///////////////////////////////////////////////////////////////
Hostile::Hostile( char * fileName, int id, Pathfinder & pather, Grid<char> & occGrid,
		float walkSpeed, float turnSpeed)
		: Agent( fileName, id, pather, occGrid, walkSpeed, turnSpeed ), isFlipped( false )
{
}

///////////////////////////////////////////////////////////////
// Default destructor.
///////////////////////////////////////////////////////////////
Hostile::~Hostile(void)
{
}


///////////////////////////////////////////////////////////////
// Getters and Setters
///////////////////////////////////////////////////////////////

// get hostile ID
int Hostile::getID() {
	return this->hostileID;
}

// get state.
int Hostile::getState() {
	return this->currentState;
}

// set state.
void Hostile::setState(int state) {
	this->currentState = state;
}

///////////////////////////////////////////////////////////////
// FSM checkState() code.  enum defined in .h file.
///////////////////////////////////////////////////////////////

// check state, initiate actions.
void Hostile::checkHostileState() {
	int s = this->currentState;

	// PATROL, FROZEN, CAPTURED 
	switch (s) {
		case PATROL:
			// animate patrol, either have waypoints Start,End defined, or just animate character.
			// animatePatrol();
			break;
		case FROZEN:
			// do nothing, is frozen (innocents cannot run yet).
			break;
		case CAPTURED:
			// innocents can now run away.
			// do memory clean up on this object.
			break;
		default:
			// default case.
			break;
	}
}

// check for event updates from environment, other objects, user, etc (should be pulled out eventually).
void Hostile::checkHostileEvent(int eventID) {
	switch (eventID) {
		case SEEN_BY_ROBOT:
			// change state to frozen.
			playAnimation(Animation::Die);
			break;
		case PC_ATTACK:
			// do attack maneuvors.
			break;
		default:
			// do nothing.
			break;
	}
}